package com.zdy.service;

import com.zdy.dao.BookMapper;
import com.zdy.pojo.Books;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by 逸足天涯
 * on 3/13/2020.
 */
@Service
public class BookServiceImpl implements BookService {
    private BookMapper bookMapper;

    public void setBookMapper(BookMapper bookMapper) {
        this.bookMapper = bookMapper;
    }

    @Override
    public int updateBooks(Books books) {
        return bookMapper.updateBooks(books);
    }

    @Override
    public int addbook(Books books) {
        return bookMapper.addbook(books);
    }

    @Override
    public int deleteBookById(int id) {
        return bookMapper.deleteBooks(id);
    }



    @Override
    public List<Books> queryAllBooks() {
        return bookMapper.queryAllBooks();
    }

    @Override
    public Books queryOneBookById(int id) {
        return bookMapper.queryOneBookById(id);
    }


    @Override
    public Books queryBookByName(String bookName) {
        bookMapper.queryBookByName(bookName);
        return bookMapper.queryBookByName(bookName);
    }
}
